#include <cstdint>
#include <fmt/core.h>

int main()
{
    uint32_t number = 0x12345678;
    /**
     * &number get the address, you can consider it as get a pointer
     * which means you get (uint32_t *) which contains the value of number
     * (uint8_t *) cast the pointer to (uint8_t *)
     * and the last "*" dereference the pointer to get the value
     * So you get the first byte of number
     */
    if (*((uint8_t*) &number) == 0x78)
    {
        fmt::print("Little Endian\n");
    }
    else
    {
        fmt::print("Big Endian\n");
    }
    return 0;
}
